<?php
/**
 * 统计验证器
 */

namespace app\common\validate;

class TongjiValidate extends CommonBaseValidate
{
    protected $rule = [
            'user_id|用户' => 'require',
    'type_id|分类' => 'require',
    'parent_id|大分类' => 'require',
    'num|数量' => 'require',
    'spec_id|规格' => 'require',
    'brand_id|单位' => 'require',

    ];

    protected $message = [
            'user_id.required' => '用户不能为空',
    'type_id.required' => '分类不能为空',
    'parent_id.required' => '大分类不能为空',
    'num.required' => '数量不能为空',
    'spec_id.required' => '规格不能为空',
    'brand_id.required' => '单位不能为空',

    ];

    protected $scene = [
        'admin_add'     => ['user_id', 'type_id', 'parent_id', 'num', 'spec_id', 'brand_id', 'price', 'money', ],
        'admin_edit'    => ['id', 'user_id', 'type_id', 'parent_id', 'num', 'spec_id', 'brand_id', 'price', 'money', ],
        'admin_del'     => ['id', ],
        'admin_disable' => ['id', ],
        'admin_enable'  => ['id', ],
        'api_add'       => ['user_id', 'type_id', 'parent_id', 'num', 'spec_id', 'brand_id', 'price', 'money', ],
        'api_info'      => ['id', ],
        'api_edit'      => ['id', 'user_id', 'type_id', 'parent_id', 'num', 'spec_id', 'brand_id', 'price', 'money', ],
        'api_del'       => ['id', ],
        'api_disable'   => ['id', ],
        'api_enable'    => ['id', ],
    ];
}
